Currently, more than ninety percent of the still image formats on the communication network are JPEG (Joint Photographic Experts Group) format. Most of the multi-media electronic products utilize JPEG as default format to transfer image files on-line.
A JPEG file can be divided into a plurality of frames for encoding and decoding procedures. Two DCT-based (Discrete Cosine Transform) compression modes, baseline and progressive, of JPEG files are currently available. In the baseline mode, the JPEG frame is scanned at a time to generate image information. In the progressive mode, the JPEG frame is repeatedly scanned at several scans to form the image information.
There is a need to create progressive image decoder which is fully accelerated by hardware to decode image file. Since the progressive mode comes along with much higher complexity, it raises a problem of low decoding speed in the conventional image decoder. It is an important issue to have a better JPEG decoder for rapidly decoding JPEG images in either baseline or progressive modes.
Conventionally, a JPEG image file in progressive mode is scanned by DC first scan, DC refine scan, AC first scan, or AC refine scan. When an image file is scanned in DC scan, the scan contains only DCT coefficient 0. If an image frame is scanned in AC scan, the scan contains no DCT coefficient 0. Additionally, a first scan means that a scan contains MSBs (most significant bits) of DCT coefficients and a refine scan means that a scan contains no MSBs of DCT coefficients. For progressive JPEG images, DC coefficients can be completely retrieved according to each DC first scan and DC refine scan. Similarly, AC coefficients can be fully retrieved according to each AC first scan and AC refine scan.
Particularly, due to the nature of progressive JPEG compression, a memory unit serves as a temporary buffer for storing the whole JPEG image, which is necessary for decoding a progressive JPEG image. Generally, the memory unit is used to store the intermediate, partially decoded coefficients. All coefficients must remain in the memory unit until all scan procedures are processed.
The size of memory unit is determined by the decoding image size. If the image size is W×H, the size of the memory unit will be W×H×N1×N2, where N1 represents the number of the components in the decoding image and N2 represents the number of bits in each coefficient of each component. For example, assuming there are totally 3 components and each coefficient of a component is 11 bits, for a VGA size, the size of the memory unit should be about 1.2 Mbytes (Megabytes) (640×480×3×11). For portable electronic devices, such as cellular phones and PDA, it is undesirable to allocate 1.2 Mbytes memory for progressive JPEG image decoding.
Consequently, there is a need to provide a novel image-decoding system to solve problems of speed performance and memory usage.